﻿namespace MyAnt.Core.Resource
{
	public class ResourceUtil
	{
		public static bool CanBePickedUp(ResourceType r)
		{
			return r != ResourceType.Air && r != ResourceType.Rock;
		}

		public static ResourceType PickupReplace(ResourceType r)
		{
			switch (r)
			{
				case ResourceType.Air:
					return ResourceType.Air;
				case ResourceType.Food:
					return ResourceType.Air;
				case ResourceType.Grass:
					return ResourceType.Grass;
				case ResourceType.Rock:
					return ResourceType.Rock;
				case ResourceType.Sand:
					return ResourceType.Air;
				case ResourceType.Waste:
					return ResourceType.Air;
				case ResourceType.Water:
					return ResourceType.Water;
			}
			return ResourceType.Air;
		}

		public static ResourceType Pickup(ResourceType r)
		{
			switch (r)
			{
				case ResourceType.Air:
					return ResourceType.Air;
				case ResourceType.Food:
					return ResourceType.Food;
				case ResourceType.Grass:
					return ResourceType.Grass;
				case ResourceType.Rock:
					return ResourceType.Air;
				case ResourceType.Sand:
					return ResourceType.Sand;
				case ResourceType.Waste:
					return ResourceType.Waste;
				case ResourceType.Water:
					return ResourceType.Water;
			}
			return ResourceType.Air;
		}
	}
}